exports.setUserStatus = function(req, options){
    req.session.userInfo = options;
}
exports.checkUserStatus = function(req, res, next){
    if(req.session){
        if(req.session.userInfo){
            next();
        }else{
            res.redirect('/admin/login/');
        }
    }else{
        res.redirect('/admin/login/');
    }
}
exports.destroyUserStatus = function(req, res, next) {
    req.session.destroy(function(err) {
        // cannot access session here
        res.send({
            code: 200,
            msg: '退出后台管理系统'
        });
    })
}